{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "source": [
    "import pandas as pd\r\n",
    "\r\n",
    "data = {\r\n",
    "'电影名称':[\"California Man\",\"He's Not Really into Dudes\",\"Beautiful Woman\",\"Kevin longblade\",\"Robo slayer 3000\",\"Amped II\"],\r\n",
    "'打斗镜头':[3,2,1,101,99,98],\r\n",
    "'接吻镜头':[104,100,81,10,5,2],\r\n",
    "'电影类型':[\"爱情片\",\"爱情片\",\"爱情片\",\"动作片\",\"动作片\",\"动作片\"]\r\n",
    "}\r\n",
    "\r\n",
    "data_df = pd.DataFrame(data)\r\n",
    "\r\n",
    "data_df"
   ],
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "                         电影名称  打斗镜头  接吻镜头 电影类型\n",
       "0              California Man     3   104  爱情片\n",
       "1  He's Not Really into Dudes     2   100  爱情片\n",
       "2             Beautiful Woman     1    81  爱情片\n",
       "3             Kevin longblade   101    10  动作片\n",
       "4            Robo slayer 3000    99     5  动作片\n",
       "5                    Amped II    98     2  动作片"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>电影名称</th>\n",
       "      <th>打斗镜头</th>\n",
       "      <th>接吻镜头</th>\n",
       "      <th>电影类型</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>California Man</td>\n",
       "      <td>3</td>\n",
       "      <td>104</td>\n",
       "      <td>爱情片</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>He's Not Really into Dudes</td>\n",
       "      <td>2</td>\n",
       "      <td>100</td>\n",
       "      <td>爱情片</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Beautiful Woman</td>\n",
       "      <td>1</td>\n",
       "      <td>81</td>\n",
       "      <td>爱情片</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Kevin longblade</td>\n",
       "      <td>101</td>\n",
       "      <td>10</td>\n",
       "      <td>动作片</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Robo slayer 3000</td>\n",
       "      <td>99</td>\n",
       "      <td>5</td>\n",
       "      <td>动作片</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>Amped II</td>\n",
       "      <td>98</td>\n",
       "      <td>2</td>\n",
       "      <td>动作片</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "execution_count": 1
    }
   ],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "source": [
    "new_data = [18,90]\r\n",
    "\r\n",
    "k=3"
   ],
   "outputs": [],
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "source": [
    "(data_df.iloc[:,1:3] -new_data)**2"
   ],
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "   打斗镜头  接吻镜头\n",
       "0   225   196\n",
       "1   256   100\n",
       "2   289    81\n",
       "3  6889  6400\n",
       "4  6561  7225\n",
       "5  6400  7744"
      ],
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>打斗镜头</th>\n",
       "      <th>接吻镜头</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>225</td>\n",
       "      <td>196</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>256</td>\n",
       "      <td>100</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>289</td>\n",
       "      <td>81</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>6889</td>\n",
       "      <td>6400</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>6561</td>\n",
       "      <td>7225</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6400</td>\n",
       "      <td>7744</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ]
     },
     "metadata": {},
     "execution_count": 3
    }
   ],
   "metadata": {}
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "a6dc62afd8b03c17538a9dfce2fcb18f62cec380cc7b77050462a64b7e4e4814"
  },
  "kernelspec": {
   "name": "python3",
   "display_name": "Python 3.8.0 32-bit"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.0"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}